
class OutClass{
    int a = 10;
    int b = 20;
    public void testA(){
        System.out.println("OutClass::testA()");
    }
    InnerClass p1 = new InnerClass();
    class InnerClass{
        int a = 1111;//优先访问自己类中成员
        int c;
        int d;
        public void testB(){
            //a = 200;//外部类的任何成员都能在内部类的成员方法中直接访问
            b = 200;
            testA();
            System.out.println(OutClass.this.a);
        }
    }

    public void testC(){
        p1.testB();

    }
}

public class test {
    public static void main(String[] args) {
        OutClass out = new OutClass();
        OutClass.InnerClass test1 = new OutClass().new InnerClass();
        OutClass.InnerClass test2 = out.new InnerClass();
        test1.testB();
    }
}
